﻿using System.Collections.Generic;
using StockFinder.Model;
using StockFinder.NorgatePremiumData;
using StockFinder.StockLists.SymbolListEnumerators;

namespace StockFinder.StockLists.Exchanges
{
    public class NorgateOfflineAllNasdaqNorgatePriceLoaderStockList : NorgateOfflinePriceLoaderSymbolListEnumerator
    {
        protected override Dictionary<Symbol, string> GetSymbols()
        {
            var symbolsWithFilenames = new Dictionary<Symbol, string>();
            var extractor = new NorgatePremiumDataStockFilePathsExtractor();

            var nasdaqSymbols = extractor.GetStockPriceHistoryFilenamesForSpecificDirectoryName("NASDAQ");

            foreach (var nasdaqFilename in nasdaqSymbols)
            {
                var symbolName = extractor.GetSymbolNameFromFileName(nasdaqFilename);

                symbolsWithFilenames.Add(new Symbol { Name = symbolName }, nasdaqFilename);
            }

            return symbolsWithFilenames;
        }
    }
}
